:root {
  // ----------------------------------------------- form --------------------------------------------
  // 魔改必填项
  .required-after {
    display: inline-block;
    color: @text02;
    font-size: 14px;
    font-family: SimSun, sans-serif;
    line-height: 1;
    content: '*';
    font-weight: 700;
    transform: translateY(-1px);
  }
  .required {
    .ant-form-item-label > label {
      &::after {
        .required-after();
      }
    }
  }
  .ant-form {
    .ant-form-row {
      width: 100%;
    }
    .ant-form-item {
      .ant-input-textarea {
        word-break: break-all;
      }
      .ant-input-textarea-show-count::after {
        margin-bottom: 0;
      }
      .ant-form-item-label {
        .font14();
        color: @text02;
      }
      // 表单必选标识
      .ant-form-item-required {
        &::before {
          display: none !important;
        }
        // 黑色星号*
        &::after {
          display: inline-block !important;
          color: @text02;
          font-size: 14px;
          font-weight: 700;
          font-family: SimSun, sans-serif;
          line-height: 1;
          content: '*';
          transform: translateY(-1px);
        }
      }
    }
  }

  // ----------------------------------------------- input --------------------------------------------
  // input,
  // select,
  // textarea {
  //   border-radius: 6px !important;
  // }
  .ant-input-prefix {
    color: @text03;

    .iconfont {
      color: inherit;
    }
  }
  // ----------------------------------------------- button --------------------------------------------
  // default button
  .ant-btn {
    outline: none !important; // 去除点击时的边框
    &.btn-mini {
      height: 28px;
    }
    &:focus {
      color: @text01;
      border: 1px solid @border2;
    }

    &:hover {
      color: @text01;
      background: fade(#000, 5%);
      border: 1px solid @border2;
    }

    &:active {
      background: fade(#000, 10%);
      border: 1px solid @border2;
    }
    &:disabled {
      color: rgba(0, 0, 0, 0.25);
    }
  }

  // primary button
  .ant-btn-primary {
    color: #fff;
    border: none;

    &:focus {
      color: #fff;
      background: @primary1;
      border: none;
    }

    &:hover {
      color: #fff;
      background: fade(@primary1, 88%);
      border: none;
    }

    &:active {
      color: #fff;
      background: fade(@primary1, 100%);
      border: none;
    }
    &:disabled {
      border-color: #e8e8eb;
      color: rgba(0, 0, 0, 0.25);
      background-color: rgba(0, 0, 0, 0.04);
    }
  }

  // text button
  .ant-btn-text {
    border: none;

    &:focus {
      color: rgba(25, 25, 48, 0.75);
      background: none;
      border: none;
    }

    &:hover {
      color: rgba(25, 25, 48, 0.75);
      background: rgba(0, 0, 0, 0.05);
      border: none;
    }

    &:active {
      color: rgba(25, 25, 48, 0.75);
      background: rgba(0, 0, 0, 0.1);
      border: none;
    }
  }

  // link button
  .ant-btn-link {
    padding: 0;
    height: auto;
    color: @link;
    border: none;

    &:focus {
      color: @link;
      background: none;
      border: none;
    }

    &:hover {
      color: #54bdfa;
      background: none;
      border: none;
    }

    &:active {
      color: #0074d3;
      background: none;
      border: none;
    }
    &:disabled {
      color: @text04;
    }
  }

  // dashed button
  .btn-border-style(@border-style: solid) {
    border-style: @border-style;
    &:focus {
      border-style: @border-style;
    }

    &:hover {
      border-style: @border-style;
    }

    &:active {
      border-style: @border-style;
    }
  }
  .ant-btn-dashed {
    &[dashed='true'] {
      .btn-border-style(dashed);
    }

    .btn-border-style(solid);
  }

  // 只有icon的btn
  .icon-only-btn {
    padding: 4px;
    width: unset;
    height: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  // 带icon的butoon
  .icon-with-btn {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    gap: 0 6px;
  }

  // --------------------------------- cascader item -----------------------------

  .ant-cascader-menu-item-content {
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    /* width: 100px !important; */
  }

  // --------------------------------- dropdown menu -----------------------------

  .ant-dropdown-menu {
    padding: 4px !important;
    border-radius: 4px;

    .menu-icon-item {
      display: flex;
      justify-content: center;
      align-items: center;
      color: @text01;
      gap: 0 8px;
      &.ant-dropdown-menu-item-disabled {
        color: rgba(0, 0, 0, 0.25);
      }
    }
  }
  // --------------------------------- Spin -----------------------------
  .full-screen-spin.ant-spin-spinning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh !important;
  }
  // -------------------------------------- Badge --------------------------------
  .ant-badge-count {
    box-shadow: none !important;
  }

  // -------------------------------------- Modal ----------------------------------

  .local-export-from {
    .ant-modal-body {
      padding: 40px 32px !important;
    }
    .local-checkbox {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 40px;
    }
  }

  .onLine-export-from {
    .ant-modal-body {
      padding: 24px 32px;
    }
  }

  .delete-task-dialog {
    .ant-modal-body {
      padding: 24px 32px;
    }
  }

  .ant-modal {
    .ant-modal-header {
      border-radius: 8px 8px 0 0;
      padding: 12px 20px;
      border-bottom: 1px solid var(--background-background-3, #f5f5f5);
      background: var(--background-background-1, #fff);
      margin-bottom: 0;
      .ant-modal-title {
        font-weight: 700;
        font-size: 14px;
        font-family: 'Noto Sans SC';
        height: 22px;
        width: 96%;
        .elliptical-1();
      }
    }
    .ant-modal-body {
      padding: 24px 32px;
    }

    .ant-modal-content {
      border-radius: 8px;
      overflow: hidden;
      padding: 0;
    }

    .ant-modal-footer {
      margin-top: 44px;
      border-radius: 0 0 8px 8px;
      padding: 20px 24px;
      margin-top: 0;
    }
  }

  .ant-modal-confirm {
    .ant-modal-body {
      padding: 40px 24px 20px 40px;
      .ant-modal-confirm-title {
        font-weight: 400;
        font-size: 14px;
      }
    }
    .ant-modal-confirm-body {
      align-items: unset;
    }
    .ant-modal-confirm-btns {
      margin-top: 28px;
    }
  }

  // 全屏弹窗
  .full-modal {
    .ant-modal {
      width: 100% !important;
      max-width: 100%;
      padding-bottom: 0;
      top: 0;
      margin: 0;
    }
    .ant-modal-content {
      display: flex;
      flex-direction: column;
      height: calc(100vh);
      border-radius: 0px;
    }
    .ant-modal-body {
      flex: 1;
      height: calc(80vh);
      overflow: auto;
    }
  }
  // --------------------------------- Menu -----------------------------------

  // --------------------------------- Pagination -----------------------------------

  .ant-pagination {
    // 总数
    .ant-pagination-total-text {
      margin-right: 38px;
    }

    // 页按钮
    .ant-pagination-item,
    .ant-pagination-item:hover {
      border: none;

      a {
        color: @text02;
      }
    }

    .ant-pagination-item-active {
      background-color: rgba(0, 0, 0, 0.1);
      border: none;
    }

    // 上一页下一页
    .ant-pagination-prev,
    .ant-pagination-next {
      button {
        color: @text02;
        border: none;
      }

      &.ant-pagination-disabled {
        button {
          color: @text04;
        }
      }
    }

    // 页配置
    .ant-pagination-options {
      .ant-select {
        .ant-select-selector {
          border: none !important;
          box-shadow: none !important;
          background-color: transparent !important;
          .ant-select-selection-item {
            color: @text02;
          }
        }
      }
    }
  }
  .ant-select-selector {
    padding: 0 4px;
    // .ant-select-selection-overflow {
    //   height: auto;
    // }
    // padding: 2px 4px;
    // .ant-select-selection-item {
    //   color: @text02;
    // }
    // .ant-select-selection-item {
    //   margin-top: 0px;
    //   margin-bottom: 0px;
    //   color: @text02;
    //   height: 26px;
    //   line-height: 26px;
    //   .ant-select-selection-item-content,
    //   .ant-select-selection-item-remove {
    //     height: 26px;
    //     line-height: 26px;
    //   }
    // }
  }
  .ant-select-multiple {
    .ant-select-selector:after {
      margin: 1px 0;
    }

    .ant-select-selection-item {
      height: 30px;
    }
  }
  // --------------------------------- Table -----------------------------------

  .ant-table-wrapper .ant-table {
    border: 1px solid @border1;
    border-radius: 6px;
    overflow: hidden;
    .ant-table-column-sorters {
      justify-content: start;
      gap: 0 4px;
      .ant-table-column-title {
        flex: none;
      }
    }
  }

  .admin-table.ant-table-wrapper .ant-table {
    border: none;
    // border-bottom: 1px solid @border1;
  }
  .ant-table-selection-column {
    padding: 0px 16px !important;
  }

  // .ant-table-wrapper .ant-table:not(.ant-table-bordered) .ant-table-tbody > tr:last-child > td {
  //   border-bottom: none;
  // }

  :where(.css-dev-only-do-not-override-1uxtd41).ant-table-wrapper table tr th.ant-table-selection-column,
  :where(.css-dev-only-do-not-override-1uxtd41).ant-table-wrapper table tr td.ant-table-selection-column {
    padding: 16px;
  }

  // .ant-table-thead > tr > th,
  .ant-table-tbody > tr > td,
  .ant-table tfoot > tr > th,
  .ant-table tfoot > tr > td {
    height: 54px;
    padding: 0 16px;
    background-color: #fff;
  }

  .ant-table-thead > tr > th {
    background-color: @background3;
    color: @text03;
  }
  .ant-table-tbody > tr.ant-table-row-selected > td {
    background: #fff;
  }
  .ant-table-tbody > tr > td {
    border-inline-end: 1px solid #fff0 !important;
  }
  .ant-table-tbody > tr.ant-table-row-selected:hover > td {
    background: rgba(0, 0, 0, 0.05);
  }
  .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
    display: none;
  }

  // 表格左右两边的border系统管理
  .header-right-angle {
    .ant-table {
      border-radius: 0px !important;
    }
    .ant-table-container table > thead > tr:first-child > *:first-child {
      border-radius: 0;
    }
    .ant-table-container table > thead > tr:first-child > *:last-child {
      border-radius: 0;
    }
  }

  // 被分享的表格行样式
  .ant-table-tbody tr {
    &:has([data-share='true']) {
      position: relative;
      td:first-child {
        &::before {
          content: '';
          position: absolute;
          top: 50%;
          left: -3px;
          width: 6px;
          height: 24px;
          background: #f8b954;
          border-radius: 4px;
          transform: translateY(-50%);
        }
      }
    }
  }

  // --------------------------------- CheckBox -----------------------------------
  .ant-checkbox-inner,
  .ant-tree-checkbox-inner {
    border-radius: 3px !important;
  }
  // --------------------------------- Tree -----------------------------------
  .ant-tree {
    .ant-tree-checkbox {
      margin-block-start: 0;
    }
    .ant-tree-title {
      white-space: nowrap;
    }

    .ant-tree-node-selected {
      .ant-tree-title {
        color: #fff;
      }
    }
  }

  // --------------------------------- Tooltip -----------------------------------
  // .ant-tooltip {
  //   .ant-tooltip-content {
  //     .ant-tooltip-inner {
  //       border: 1px solid #333333;
  //       color: #333333;
  //       background: #ffffff;
  //       box-shadow: none;
  //       border-radius: 0;
  //       padding: 0px 6px;
  //       min-height: unset;
  //     }
  //   }
  //   .ant-tooltip-arrow {
  //     display: none;
  //   }
  // }

  // ---------------------------------- select ------------------------------------
  .ant-select-dropdown {
    padding: 4px !important;
  }
  .ant-select-item {
    border-radius: 4px;
  }
  .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
    background-color: rgba(0, 0, 0, 0.1) !important;
  }
  .ant-select-item-option-active:not(.ant-select-item-option-disabled) {
    background-color: rgba(102, 66, 66, 0.05) !important;
  }
  .ant-select-selector {
    padding-left: 2px;
  }
}

.ant-input-affix-wrapper {
  border-radius: 6px;
}
